<template>
  <view
    class="tui-footer-class tui-footer"
    :class="[fixed ? 'tui-fixed' : '']"
    :style="{ backgroundColor: backgroundColor, bottom }"
  >
    <view class="tui-footer-copyright" :style="{ color: color, fontSize: size + 'rpx' }">
      {{ copyright }}
    </view>
  </view>
</template>

<script lang="ts" setup>
  import { propTypes } from '@/utils/propTypes';

  defineProps({
    //底部文本
    copyright: propTypes.string.def('i会纷享'),
    //copyright 字体颜色
    color: propTypes.string.def('#A7A7A7'),
    //copyright 字体大小
    size: propTypes.number.def(24),
    //footer背景颜色
    backgroundColor: propTypes.string.def('transparent'),
    //是否固定在底部
    fixed: propTypes.bool.def(true),
    bottom: propTypes.string.def('0px'),
  });
</script>

<style lang="scss" scoped>
  .tui-footer {
    width: 100%;
    overflow: hidden;
    padding: 30rpx 24rpx;
    box-sizing: border-box;
  }

  .tui-fixed {
    position: fixed;
    z-index: 9999;
    bottom: 0;
    left: 0;
  }

  .tui-footer-link {
    color: #596d96;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28rpx;
  }

  .tui-link {
    position: relative;
    padding: 0 18rpx;
    line-height: 1;
  }

  .tui-link::before {
    content: ' ';
    position: absolute;
    right: 0;
    top: 0;
    width: 1px;
    bottom: 0;
    border-right: 1px solid #d3d3d3;
    -webkit-transform-origin: 100% 0;
    transform-origin: 100% 0;
    -webkit-transform: scaleX(0.5);
    transform: scaleX(0.5);
  }

  .tui-link:last-child::before {
    border-right: 0 !important;
  }

  .tui-link-hover {
    opacity: 0.5;
  }

  .tui-footer-copyright {
    font-size: 24rpx;
    color: #a7a7a7;
    line-height: 1;
    text-align: center;
    padding-top: 16rpx;
    // padding-bottom: env(safe-area-inset-bottom);
  }
</style>
